package com.huitone.gddw.service.dto.business;

import java.util.Date;

import com.huitone.gddw.common.excel.ColToProperty;
import com.huitone.gddw.common.excel.TabCol;
import com.huitone.gddw.utils.DateTimeUtils;
import com.huitone.gddw.utils.SysLoginUtil;

/**
 * 短信发送记录 DTO 对象
 * @author wuluodan
 *
 */
public class SendSmDTO {

	@ColToProperty
	@TabCol(Index = 1, title = "序号", width = "30")
	private Integer seq;
	
	private String recId;
	
	private Date sendTime;
	
	@ColToProperty
	@TabCol(Index = 2, title = "日期", width = "65")
	private String sendTimeDate;
	
	@ColToProperty
	@TabCol(Index = 3, title = "短信序号", width = "120")
	private String smSeq;
	
	private String svrNode;

	@ColToProperty
	@TabCol(Index = 10, title = "业务端", width = "90")
    private String srvName;

    private String serviceCode;

	@ColToProperty
	@TabCol(Index = 11, title = "短信类型", width = "90")
    private String serviceName;
    
	@ColToProperty
	@TabCol(Index = 4, title = "号码", width = "90")
    private String userNo;
    
	@ColToProperty
	@TabCol(Index = 12, title = "短信内容", width = "150")
    private String smContent;
    
	private Date recvTime;
	
	@ColToProperty
	@TabCol(Index = 5, title = "接收时间", width = "80")
    private String recvTimeTime;
    
	@ColToProperty
	@TabCol(Index = 6, title = "递交时间", width = "80")
    private String sendTimeTime;
    
	private Date sendFeedbackTime;
	
//	@ColToProperty
//	@TabCol(Index = 10, title = "递交通知时间", width = "80")
    private String sendFeedbackTimeTime;
    
    private String sendFeedbackResult; // 递交通知结果
	
	private String sendport;
	
	private String gateLinkId;
	
	private String gateLinkName;
	
	private String sendCode;

	private String maxCount;

	@ColToProperty
	@TabCol(Index = 7, title = "递交结果", width = "50")
	private String sendMsg;
	
	private String sendResultSeq;
	
	private Date recvReportTime; // 状态报告时间
	
	@ColToProperty
	@TabCol(Index = 8, title = "报告返回时间", width = "")
	private String recvReportTimeTime;
	
	private Date reportFeedbackTime; // 报告通知时间
	
	private String reportFeedbackResult; // 报告通知结果
	
	private String reportSeq;
	
	@ColToProperty
	@TabCol(Index = 9, title = "报告结果", width = "")
	private String resultMsg; // 状态报告说明
	
	private String resultCode; // 状态报告码

	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public String getRecId() {
		return recId;
	}

	public void setRecId(String recId) {
		this.recId = recId;
	}

	public Date getSendTime() {
		return sendTime;
	}

	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}

	public String getSendTimeDate() {
		if (this.sendTime != null)
			return DateTimeUtils.dateToStr(this.sendTime, "yyyy/MM/dd");
		return null;
	}

	public void setSendTimeDate(String sendTimeDate) {
		this.sendTimeDate = sendTimeDate;
	}

	public String getSmSeq() {
		return smSeq;
	}

	public void setSmSeq(String smSeq) {
		this.smSeq = smSeq;
	}

	public String getSvrNode() {
		return svrNode;
	}

	public void setSvrNode(String svrNode) {
		this.svrNode = svrNode;
	}

	public String getSrvName() {
		return srvName;
	}

	public void setSrvName(String srvName) {
		this.srvName = srvName;
	}

	public String getServiceCode() {
		return serviceCode;
	}

	public void setServiceCode(String serviceCode) {
		this.serviceCode = serviceCode;
	}

	public String getServiceName() {
		return serviceName;
	}

	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}

	public String getUserNo() {
		return userNo;
	}

	public void setUserNo(String userNo) {
		this.userNo = userNo;
	}

	public String getSmContent() {
		return smContent == null ? "" : SysLoginUtil.isAdmin() ? smContent : getLikeContent(smContent);
	}
	
	public String getRealSmContent() {
		return smContent;
	}
	
	private String getLikeContent(String content) {
		if (content.length() < 3) {
			return content;
		}
		StringBuffer sb = new StringBuffer("****** ");
		sb.append(content.substring(content.length() / 3, content.length() / 3 * 2));
		sb.append(" ******");
		return sb.toString();
	}

	public void setSmContent(String smContent) {
		this.smContent = smContent;
	}

	public Date getRecvTime() {
		return recvTime;
	}

	public void setRecvTime(Date recvTime) {
		this.recvTime = recvTime;
	}

	public String getRecvTimeTime() {
		if (this.recvTime != null)
			return DateTimeUtils.dateToStr(this.recvTime, "MMdd HH:mm:ss");
		return null;
	}

	public void setRecvTimeTime(String recvTimeTime) {
		this.recvTimeTime = recvTimeTime;
	}

	public String getSendTimeTime() {
		if (this.sendTime != null)
			return DateTimeUtils.dateToStr(this.sendTime, "MMdd HH:mm:ss");
		return null;
	}

	public void setSendTimeTime(String sendTimeTime) {
		this.sendTimeTime = sendTimeTime;
	}

	public Date getSendFeedbackTime() {
		return sendFeedbackTime;
	}

	public void setSendFeedbackTime(Date sendFeedbackTime) {
		this.sendFeedbackTime = sendFeedbackTime;
	}

	public String getSendFeedbackTimeTime() {
		if (this.sendFeedbackTime != null)
			return DateTimeUtils.dateToStr(this.sendFeedbackTime, "MMdd HH:mm:ss");
		return null;
	}

	public void setSendFeedbackTimeTime(String sendFeedbackTimeTime) {
		this.sendFeedbackTimeTime = sendFeedbackTimeTime;
	}

	public String getSendFeedbackResult() {
		return sendFeedbackResult;
	}

	public void setSendFeedbackResult(String sendFeedbackResult) {
		this.sendFeedbackResult = sendFeedbackResult;
	}

	public String getSendport() {
		return sendport;
	}

	public void setSendport(String sendport) {
		this.sendport = sendport;
	}

	public String getGateLinkId() {
		return gateLinkId;
	}

	public void setGateLinkId(String gateLinkId) {
		this.gateLinkId = gateLinkId;
	}

	public String getGateLinkName() {
		return gateLinkName;
	}

	public void setGateLinkName(String gateLinkName) {
		this.gateLinkName = gateLinkName;
	}

	public String getSendCode() {
		return sendCode;
	}

	public void setSendCode(String sendCode) {
		this.sendCode = sendCode;
	}

	public String getSendMsg() {
		return sendMsg;
	}

	public void setSendMsg(String sendMsg) {
		this.sendMsg = sendMsg;
	}

	public String getSendResultSeq() {
		return sendResultSeq;
	}

	public void setSendResultSeq(String sendResultSeq) {
		this.sendResultSeq = sendResultSeq;
	}

	public Date getRecvReportTime() {
		return recvReportTime;
	}

	public void setRecvReportTime(Date recvReportTime) {
		this.recvReportTime = recvReportTime;
	}
	
	public void setRecvReportTimeTime(String recvReportTimeTime) {
		this.recvReportTimeTime = recvReportTimeTime;
	}

	public String getRecvReportTimeTime() {
		if (this.recvReportTime != null)
			return DateTimeUtils.dateToStr(this.recvReportTime, "MMdd HH:mm:ss");
		return null;
	}

	public Date getReportFeedbackTime() {
		return reportFeedbackTime;
	}

	public void setReportFeedbackTime(Date reportFeedbackTime) {
		this.reportFeedbackTime = reportFeedbackTime;
	}

	public String getReportFeedbackTimeTime() {
		if (this.reportFeedbackTime != null)
			return DateTimeUtils.dateToStr(this.reportFeedbackTime, "MMdd HH:mm:ss");
		return null;
	}

	public String getReportFeedbackResult() {
		return reportFeedbackResult;
	}

	public void setReportFeedbackResult(String reportFeedbackResult) {
		this.reportFeedbackResult = reportFeedbackResult;
	}

	public String getReportSeq() {
		return reportSeq;
	}

	public void setReportSeq(String reportSeq) {
		this.reportSeq = reportSeq;
	}

	public String getResultMsg() {
		return resultMsg;
	}

	public void setResultMsg(String resultMsg) {
		this.resultMsg = resultMsg;
	}

	public String getResultCode() {
		return resultCode;
	}

	public void setResultCode(String resultCode) {
		this.resultCode = resultCode;
	}
	
	public String getMaxCount() {
		return maxCount;
	}

	public void setMaxCount(String maxCount) {
		this.maxCount = maxCount;
	}
	
}
